home *** CD-ROM | disk | FTP | other *** search
/ The X-Philes (2nd Revision) / The X-Philes Number 1 (1995).iso / xphiles / hp48hor2 / selfmod.doc < prev    next >
Text File  |  1995-03-31  |  793b  |  20 lines

  1. (Comp.sys.hp48) 
  2.   Item: 1254 
  3.   Resp: 2 of 2 by detlef@mwhh.hanse.de 
  4. Author: [Detlef Mueller] 
  5.   Date: Sat Jun 13 1992 
  6.  
  7. The workaround for putting selfmodifing programs into a library is to put 
  8. the following shell around them: 
  9.  
  10.   \<< { qed } OBJ\-> DROP   @ here 'qed' is the command that modifies itself 
  11.       #7E99h SYSEVAL DROP   @ ROMPTR@ - recall pointer to library command 
  12.       NEWOB EVAL            @ copy ob into TEMPOB, execute it from there 
  13.   \>> 
  14.  
  15. [Of course, replace "qed" above with whatever library command you 
  16. wish.  It'll work with any self-modifying program as long as there's 
  17. enough free memory for NEWOB to make a second copy of it.  If this 
  18. workaround fails at NEWOB with an "Insufficient Memory" error, then 
  19. you're out of luck.  -jkh-] 
  20.